package com.xh.xyzp.controller;

import com.xh.xyzp.common.domain.vo.resp.ApiResult;
import com.xh.xyzp.common.domain.vo.resp.PageResp;
import com.xh.xyzp.domain.vo.AdmissionPageReq;
import com.xh.xyzp.domain.vo.AdmissionResp;
import com.xh.xyzp.domain.vo.AdmissionSubmitReq;
import com.xh.xyzp.service.AdmissionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "录取接口")
@RestController
@RequestMapping("/admission")
public class AdmissionController {

    @Autowired
    private AdmissionService admissionService;

    @ApiOperation("详细信息")
    @PostMapping("/info/{admissionId}")
    public ApiResult<AdmissionResp> getInfo(@PathVariable("admissionId") Long admissionId) {
        return ApiResult.success(admissionService.getInfo(admissionId));
    }

    @ApiOperation("新增/编辑")
    @PostMapping("/submit")
    public ApiResult<Void> submit(@RequestBody AdmissionSubmitReq req) {
        admissionService.submit(req);
        return ApiResult.success();
    }

    @ApiOperation("列表")
    @PostMapping("/list")
    public ApiResult<PageResp<AdmissionResp>> getList(@RequestBody AdmissionPageReq req) {
        return ApiResult.success(admissionService.getList(req));
    }
} 